import dayUtils from "./dayUtils";

export default {
  productIds() {
    return ['198,200,201']
  },
  idAndTitleMap() {
    return [
      {id: 198, title: '全科永久会员', introduceImg: '/static/vip/vip_vs.png'},
      // {id: 199, title: '科一科四会员', introduceImg: '/static/vip/icon_vip_14.png'},
      {id: 200, title: '科目一会员', introduceImg: 'https://down.qwdata.vip/app_icon/icon_vip_1_1.png'},
      {id: 201, title: '科目234会员', introduceImg: 'https://down.qwdata.vip/app_icon/icon_vip_234_1.png'},
      // {id: 202, title: '科目四会员', introduceImg: '/static/vip/icon_vip_4.png'},
    ]
  },
  isKemu1(productId) {
    return productId === 200
  },
  getProductTitle(product) {
    const mappedItem = this.idAndTitleMap().find(item => item.id === product.id);
    return mappedItem ? mappedItem.title : product.title;
  },
  getIntroduceImg(productId) {
    const mappedItem = this.idAndTitleMap().find(item => item.id === productId);
    return mappedItem ? mappedItem.introduceImg : '';
  },
  isForeverVIP(vipEndAt) {
    const d = dayUtils.diffYear(vipEndAt)
    return d > 10
  }
}
